<template>
	<view>
		<view class="meditation_list_item" v-for="(item,index) in meditationList" :key="index" @click="meditationClickIndex(index)">
			<image class="meditation_list_image" :src="item.icon" mode="aspectFill"></image>
			<view class="meditation_list_text_content">
				<text class="meditation_list_title">{{ item.title }}</text>
				<text class="meditation_list_subtitle">{{ item.subtitle }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				meditationList: [],
			};
		},
		onLoad() {
			this.meditationList = [
				{
					icon: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-83418c8b-2862-4eac-a6ec-bf64544c5621/cf0b47e3-6906-4da5-acc8-534a8fb4f0ca.jpg",
					title: "文本过长省略",
					subtitle: "文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示"
				},
				{
					icon: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-83418c8b-2862-4eac-a6ec-bf64544c5621/cf0b47e3-6906-4da5-acc8-534a8fb4f0ca.jpg",
					title: "文本过长省略",
					subtitle: "文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示"
				},
				{
					icon: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-83418c8b-2862-4eac-a6ec-bf64544c5621/cf0b47e3-6906-4da5-acc8-534a8fb4f0ca.jpg",
					title: "文本过长省略",
					subtitle: "文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示文本过长省略或文本过长换行显示"
				}
			]
		},

		methods: {
			meditationClickIndex(index) {
				let item = this.meditationList[index];
				console.log(item);
				uni.navigateTo({
					url:"../meditationDetail/meditationDetail"
				});
			},
		}
		
	}
</script>

<style lang="scss">
	.meditation_list_item {
		display: flex;
		margin: 30rpx 30rpx 0rpx 30rpx;
	}
	
	.meditation_list_image {
		width: 250rpx;
		height: 150rpx;
		border-radius: 10rpx;
		flex-shrink: 0;
	}
	
	.meditation_list_text_content {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin: 0rpx 0rpx 0rpx 20rpx;
	}
	
	.meditation_list_title {
		width: 420rpx;
		font-size: 36rpx;
		color: #FFFFFF;
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-wrap: break-word;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
	}
	
	.meditation_list_subtitle {
		width: 420rpx;
		font-size: 28rpx;
		color: #969696;
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-wrap: break-word;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

</style>
